﻿
#ifndef __STAR_COMMON_EXCEL_DATA_H_
#define __STAR_COMMON_EXCEL_DATA_H_

#include <string>
#include <map>
#include <vector>

#include "../CommonDef.h"
#include "EXDType.h"

dn_namespace_beg 


struct EXD_Line_Base
{
	void* get(int index);


	int LineIdx;
	
	std::vector<void*> dataVec;
};


struct EXD_Table_Base
{
	~EXD_Table_Base();

	EXD_Line_Base*	find(int ID);
	EXD_Line_Base*	get(int Index);
	size_t			size();

	virtual bool Build(std::string FillInPath) {return true;};

	std::map<int,EXD_Line_Base*> ID_LineMap;
	std::map<int,EXD_Line_Base*> Idx_LineMap;
};

/*struct EXD_Table_excel_index;
struct EXD_Line_excel_index;

extern EXD_Table_excel_index* GT_excel_index;

struct EXD_Table_excel_index:public EXD_Table_Base
{
	bool Build(std::string FillInPath);

	EXD_Line_excel_index* find(int ID);
	EXD_Line_excel_index* get(int Idx);

};

struct EXD_Line_excel_index:public EXD_Line_Base
{
	std::string name;
	int			 id;

	std::string string_test;
	int			 int_test;
	float		 float_test;
	std::vector<std::string>	v_string_test;
	std::vector<int>		v_int_test;
	std::vector<float>		v_float_test;

};*/


//marco for regist excel table's line info
#define EXD_DEFINE_BEGIN(ExcelName) \
struct EXD_Table_##ExcelName;\
struct EXD_Line_##ExcelName;\
	extern EXD_Table_##ExcelName* GT_##ExcelName;\
struct EXD_Table_##ExcelName:public EXD_Table_Base\
{\
	bool Build(std::string FillInPath);\
	EXD_Line_##ExcelName* find(int ID);\
	EXD_Line_##ExcelName* get(int Idx);\

#define EXD_VALUE(Type,Name)	int Row_##Name;\

#define EXD_DEFINE_END(ExcelName)	};


#include "DefineInc.h"
#include "DefineInc_End.h"


#define EXD_DEFINE_BEGIN(ExcelName) \
struct EXD_Line_##ExcelName:public EXD_Line_Base\
{\

#define EXD_VALUE(Type,Name)	Type Name;\
		
#define EXD_DEFINE_END(ExcelName)	};

#include "DefineInc.h"
#include "DefineInc_End.h"




dn_namespace_end 





#endif






